<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src/components/MMS/Admin/Login/Page.vue</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="..\..\..\..\..\prettify.css" />
    <link rel="stylesheet" href="..\..\..\..\..\base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(..\..\..\..\..\sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="..\..\..\..\..\index.html">All files</a> / <a href="index.html">src/components/MMS/Admin/Login</a> Page.vue
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/24</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/17</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/10</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/24</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">&lt;template&gt;
  &lt;div o-Container&gt;
    &lt;div id="txt_UserName"&gt;
      &lt;el-input v-model="octopus.passport.name" placeholder="Enter Your Account"&gt;&lt;/el-input&gt;
    &lt;/div&gt;
    &lt;div id="txt_Password"&gt;
      &lt;el-input v-model="octopus.passport.password" placeholder="Enter Your Password" v-on:keyup.enter.native="login"
                show-password&gt;&lt;/el-input&gt;
    &lt;/div&gt;
    &lt;div id="btn_Login"&gt;
      &lt;el-button type="primary" v-on:click="login"&gt;登陆/Login&lt;/el-button&gt;
    &lt;/div&gt;
    &lt;div id="div_Remember"&gt;
      &lt;input id="ck_Remember" name="ck_Remember" type="checkbox" v-model="octopus.passport.remember"/&gt;
      &lt;label for="ck_Remember"&gt;Remember Me&lt;/label&gt;
    &lt;/div&gt;
    &lt;div id="div_debug"&gt;
      &lt;div v-if="octopus.config.model == 'debug'"&gt;
        &lt;router-link to="/NewRRR/456"&gt;跳转到N/RRR, NOTE:{{oData.note}}&lt;/router-link&gt;
        {{octopus.passport.password}}&lt;br&gt;{{octopus.passport.encryption}}
        &lt;div&gt;访问方式：{{octopus.tools.isMobile()?"Phone":"PC"}}&lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;!--别名	实际键值--&gt;
  &lt;!-- v-on:keyup.delete	delete（删除）/BackSpace（退格）--&gt;
  &lt;!-- v-on:keyup.tab	Tab--&gt;
  &lt;!-- v-on:keyup.enter	Enter（回车）--&gt;
  &lt;!-- v-on:keyup.esc	Esc（退出）--&gt;
  &lt;!-- v-on:keyup.space	Space（空格键）--&gt;
  &lt;!-- v-on:keyup.left	Left（左箭头）--&gt;
  &lt;!-- v-on:keyup.up	Up（上箭头）--&gt;
  &lt;!-- v-on:keyup.right	Right（右箭头）--&gt;
  &lt;!-- v-on:keyup.down	Down（下箭头）--&gt;
  &lt;!-- v-on:keyup.ctrl	Ctrl--&gt;
  &lt;!-- v-on:keyup.alt	Alt--&gt;
  &lt;!-- v-on:keyup.shift	Shift--&gt;
  &lt;!-- v-on:keyup.meta	(window系统下是window键，mac下是command键)--&gt;
&lt;/template&gt;
&nbsp;
&lt;script&gt;
  //八爪鱼框架已由App.vue生成。
  // import {loadtemp} from '../../assets/octopus/main.js'
&nbsp;
  export default {
    name: "login",
<span class="fstat-no" title="function not covered" >    data() {</span>
<span class="cstat-no" title="statement not covered" >      return {</span>
        octopus: this.$parent.octopus
      }
    },
<span class="fstat-no" title="function not covered" >    created: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了created事件。");</span>
    },
<span class="fstat-no" title="function not covered" >    mounted: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了mounted事件。");</span>
    },
<span class="fstat-no" title="function not covered" >    updated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了updated事件。");</span>
    },
<span class="fstat-no" title="function not covered" >    activated: function () {</span>
      // 如果账户、密码、appKey都有数据，则提交自动登录。
<span class="cstat-no" title="statement not covered" >      if (!this.octopus.tools.IsNullOrEmpty(this.octopus.passport.name)</span>
        &amp;&amp; !this.octopus.tools.IsNullOrEmpty(this.octopus.passport.password)
        &amp;&amp; !this.octopus.tools.IsNullOrEmpty(this.octopus.passport.appKey)) {
<span class="cstat-no" title="statement not covered" >        this.auto();</span>
      }
      // 如果不是移动端，则跳转到web
<span class="cstat-no" title="statement not covered" >      if (this.octopus.tools.isMobile()) {</span>
<span class="cstat-no" title="statement not covered" >        this.octopus.router.jump("/admin/loginApp");</span>
      }
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了activated事件。");</span>
    },
<span class="fstat-no" title="function not covered" >    deactivated: function () {</span>
<span class="cstat-no" title="statement not covered" >      this.octopus.tips.debug("Login.vue执行了deactivated事件。");</span>
    },
    // 和computed的区别在于computed只有在内部使用的变量发生变化时重新计算。
    // 而methods是只要渲染则立刻会执行。
    methods: {
      // 登录前置审核
<span class="fstat-no" title="function not covered" >      login: function () {</span>
        // 提交的时候判断是否是已经加密，如果没有，则提交登录的时候对数据进行加密。
<span class="cstat-no" title="statement not covered" >        if (!this.octopus.passport.encryption) {</span>
          // 更新时间戳（毫秒）
<span class="cstat-no" title="statement not covered" >          this.octopus.passport.timespan = (new Date()).valueOf();</span>
<span class="cstat-no" title="statement not covered" >          this.octopus.passport.password = this.octopus.tools.md5(this.octopus.passport.name</span>
            + "marco" + this.octopus.passport.timespan + "july" + this.octopus.passport.password);
        }
        // 触发登录函数
<span class="cstat-no" title="statement not covered" >        this.auto();</span>
      },
<span class="fstat-no" title="function not covered" >      auto: function () {</span>
<span class="cstat-no" title="statement not covered" >        let o = this;</span>
        // 获取护照数据，不管成功与否，全部设置为true。
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >        this.octopus.request.security.passport.get(function (passport_data) {</span></span>
<span class="cstat-no" title="statement not covered" >          o.octopus.passport.encryption = true;</span>
<span class="cstat-no" title="statement not covered" >          if (!o.octopus.tools.IsNullOrEmpty(passport_data) &amp;&amp; passport_data.status.code == 200) {</span>
<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >            o.octopus.request.security.token.get(function (token_data) {</span></span>
<span class="cstat-no" title="statement not covered" >              if (!o.octopus.tools.IsNullOrEmpty(token_data) &amp;&amp; token_data.status.code == 200) {</span>
                // 调试时打印获取到权限数据。
<span class="cstat-no" title="statement not covered" >                o.octopus.tips.debug("Login页面Auto更新护照：" + JSON.stringify(passport_data));</span>
                // 执行跳转系统内页
<span class="cstat-no" title="statement not covered" >                o.octopus.router.jump("/admin/home");</span>
              } else {
<span class="cstat-no" title="statement not covered" >                o.octopus.tips.error(token_data);</span>
              }
            });
          } else {
<span class="cstat-no" title="statement not covered" >            o.octopus.tips.error(passport_data);</span>
          }
        });
      },
    },
    props: ["oData"]//接收App.vue传入的octopus对象，但是目前已经用 octopus: this.$parent.octopus代替
  }
&lt;/script&gt;
&nbsp;
&lt;style scoped&gt;
&nbsp;
&lt;/style&gt;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Mon Jan 20 2020 17:54:15 GMT+0800 (GMT+08:00)
</div>
</div>
<script src="..\..\..\..\..\prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="..\..\..\..\..\sorter.js"></script>
</body>
</html>
